Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#9] Task CRUD API 스펙 정의 및 생성 #10

Merged
merged 22 commits into from
Sep 2, 2024
Merged

Conversation

olivejua
Copy link
Collaborator

변경 내용

  1. Task API 생성
  2. Spring RestDocs 설정 추가
    • build.gradle에 RestDocs 설정
    • index.adoc 파일 생성 및 Task API 문서 작성
  3. Integration Test 코드 작성
  4. Lombok 플러그인 추가
  5. jackson-datatype-jsr310 dependency 추가
    • jackson라이브러리의 objectMapper로 LocalDateTime 타입을 직렬화 시 에러 현상 해결 java 8 date/time type 'java.time.localdatetime' not supported by default

@olivejua olivejua added the feature New feature or request label Aug 19, 2024
@olivejua olivejua self-assigned this Aug 19, 2024

@Test
void 조회할_Task가_존재하지_않는다면_실패응답메시지를_받는다() throws Exception {
mockMvc.perform(RestDocumentationRequestBuilders.get("/v1/tasks/{id}", 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mockMvctestRestTemplate

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tomcat Server에 대해서 잘 모르는것 같아 우선 정리하고, 두가지의 차이점을 알아본다음에 필요한 경우 수정해보겠습니다!
우선 PR이 오래 살아있는 것 같아 나누어서 다음 PR로 나누어서 올리겠습니다 😀


public record TaskCreateRequest(
String title,
String description,
TimeFrame timeFrame
) {}
) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다른 부분이랑 스타일이 다른 것 같네요?

Copy link
Collaborator Author

@olivejua olivejua Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spring Validation 의존성을 추가하기 전에 Request에 대한 Validation을 진행해야할 것 같아 Assert 를 추가한 유효성검증 로직을 추가하면서 생성자를 만들었습니다. Spring Validation Annotation을 붙이면 해당 생성자는 제거하려고 합니다!

@f-lab-lyan
Copy link
Collaborator

전체적으로는 괜찮은 것 같습니다. mockMVC는 나중에 업데이트 하실 예정이신건가요? 그럼 이 PR은 머지해도 괜찮을 것 같네요.

@olivejua
Copy link
Collaborator Author

olivejua commented Sep 2, 2024

넵 mockMvc 내용은 별도로 올리겠습니다! 리뷰 감사합니다 😃

@olivejua olivejua merged commit 7492d04 into main Sep 2, 2024
1 check passed
@olivejua olivejua deleted the feature/9-create_apis branch September 5, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants